package com.naizhuai.Model.db.search;

import android.arch.persistence.room.Dao;

import android.arch.persistence.room.Delete;

import android.arch.persistence.room.Insert;
import android.arch.persistence.room.OnConflictStrategy;
import android.arch.persistence.room.Query;

import com.naizhuai.Model.db.Tables;
import com.naizhuai.Model.db.user.PersonUserBean;

import java.util.List;


@Dao
public interface SearchHistoryDao {


    @Query("SELECT * FROM "+ Tables.SEARCH_TABLE+" where userId=:userId" )
    SearchHistoryBean searchUserBySid(String userId);


    @Query("SELECT * FROM "+ Tables.SEARCH_TABLE+" order by timeTemp desc limit :number" )
    List<SearchHistoryBean> searchUserLimit(int number);

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    void saveSearchHistory(SearchHistoryBean searchBean);


    @Delete
    void deleteSearchData(SearchHistoryBean bean);


}
